const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const DefineOptions = require('unplugin-vue-define-options/webpack')

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    plugins: [
      DefineOptions()
    ],
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src')
      }
    }
  }
})
module.exports = {
  devServer: {
    // allowedHosts: ['all'],
    client: {
      //将overlay设置为false即可
      overlay: false,
    },
    // 设置代理，用于在开发环境中模拟后端服务
    proxy: {
      '/': { // 代理的根路径
        target: 'http://10.11.48.47:8080', // 后端服务的真实地址
        ws: false, // 不代理 WebSocket
        changeOrigin: true, // 允许跨域请求
        pathRewrite: {
        }
      }
    }
  }
}